import axios from '@/request/http'
import { commonOutDTO, pageCommonInputDTO, pageCommonOutDTO } from '@/api/common.d'
import {
  WtjListQueryParam,
  WtjListQueryResult,
  YgdListQueryParam,
  YgdListQueryResult,
  YtjListQueryParam,
  YclListQueryResult,
  TgzListQueryParam,
  TgzListQueryResult,
  YthListQueryParam,
  JzsmjlAddInputDTO,
  JzsmjlAddOutputDTO,
  GdshCreateInputDTO,
  GdshCreateOutputDTO,
  GdgzListQueryParam,
  GdgzListQueryResult,
  GdshRecallInputDTO,
  GdshRecallOutputDTO,
  AjgddjbGetInputDTO,
  AjgddjbGetOutputDTO,
  AjtgjlSaveInputDTO,
  AjtgjlAddOutputDTO,
  AjtgjlUpdateOutputDTO,
  AjtgjlDeleteInputDTO,
  AjtgjlDeleteOutputDTO,
  TgspbGetInputDTO,
  TgspbGetOutputDTO,
  TgshListQueryParam,
  TgshListQueryResult,
  TgjlListQueryParam,
  TgjlListQueryResult,
  JzsmListQueryParam,
  JzsmListQueryResult,
  JzsmclReceiveInputDTO,
  JzsmclReceiveOutputDTO,
  JzsmclThInputDTO,
  JzsmclThOutputDTO,
  SmrAllocationInputDTO,
  SmrAllocationOutputDTO,
  JzsmclGhInputDTO,
  JzsmclGhOutputDTO,
  SmcljjdGetInputDTO,
  SmcljjdGetOutputDTO,
  AjtgjlUpdateInputDTO,
  GddshListQueryParam,
  GddshListQueryResult,
  GdyshListQueryParam,
  GdyshListQueryResult,
  GdshjlSaveInputDTO,
  GdshjlSaveOutputDTO,
  StajReceiveInputDTO,
  StajReceiveOutputDTO,
  TgshjlSaveInputDTO,
  TgshjlSaveOutputDTO,
  JzsmwcUpdateInputDTO,
  RyxxListQueryParam,
  RyxxListQueryResult,
  JzsmwcUpdateOutputDTO,
  AjgddjbxhGetInputDTO,
  AjgddjbxhGetOutputDTO,
  queryJsstclAjxxInputDTO,
  queryJsstclAjxxOutputDTO,
  createJsstgdjjdInputDTO,
  singleUploadFileOutputDTO,
  updateGhstclInputDTO,
  DgdTgzInputDTO,
  createStclgdjjdInputDTO,
  AjerwmInputDTO,
  getJzsmjsjjdInputDTO,
  CheckAjjcjlInputDTO,
  CheckAjjcjlOutputDTO,
  AjjcmxjlInputDTO,
  AjjcmxjlOutputDTO,
} from './gdgl-dto'

export default class gdglService {
  /**
   * 获取未提交列表
   */
  static queryWtjList(
    data: pageCommonInputDTO<WtjListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<WtjListQueryResult[]>>> {
    return axios.post('/api/gdgl/queryWtjList', data)
  }

  static getAjzt(data: any): Promise<any> {
    return axios.post('/api/gdgl/getAjzt', data)
  }
  /**
   * 获取已归档列表
   */
  static queryYgdList(
    data: pageCommonInputDTO<YgdListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<YgdListQueryResult[]>>> {
    return axios.post('/api/gdgl/queryYgdList', data)
  }
  /**
   * 获取已提交列表
   */
  static queryYtjList(
    data: pageCommonInputDTO<YtjListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<YclListQueryResult[]>>> {
    return axios.post('/api/gdgl/queryYtjList', data)
  }
  /**
   * 获取退改中归档信息列表
   */
  static queryTgzList(
    data: pageCommonInputDTO<TgzListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<TgzListQueryResult[]>>> {
    return axios.post('/api/gdgl/queryTgzList', data)
  }
  /**
   * 获取已退回列表
   */
  static queryYthList(
    data: pageCommonInputDTO<YthListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<YclListQueryResult[]>>> {
    return axios.post('/api/gdgl/queryYthList', data)
  }
  /**
   * 新增集中扫描记录（申请集中扫描）
   */
  static addJzsmjl(data: JzsmjlAddInputDTO): Promise<commonOutDTO<JzsmjlAddOutputDTO>> {
    return axios.post('/api/gdgl/addJzsmjl', data)
  }

  /**
   * 发起案件检测
   */
  static checkAjjcjl(data: CheckAjjcjlInputDTO): Promise<commonOutDTO<CheckAjjcjlOutputDTO>> {
    return axios.post('/api/gdgl/checkAjjcjl', data)
  }

  /**
   * 查询案件检测结果
   */
  static queryAjjcmxjl(data: AjjcmxjlInputDTO): Promise<commonOutDTO<AjjcmxjlOutputDTO[]>> {
    return axios.post('/api/gdgl/queryAjjcmxjl', data)
  }
  /**
   * 发起（提交）归档审核
   */
  static createGdsh(data: GdshCreateInputDTO): Promise<commonOutDTO<GdshCreateOutputDTO>> {
    return axios.post('/api/gdgl/createGdsh', data)
  }

  /**
   * 发起（提交）待归档->退改中
   */
  static createDgdTgz(data: DgdTgzInputDTO): Promise<commonOutDTO<GdshCreateOutputDTO>> {
    return axios.post('/api/gdgl/addAjtgjl', data)
  }
  /**
   * 获取归档跟踪信息
   */
  static queryGdgzList(data: GdgzListQueryParam): Promise<commonOutDTO<GdgzListQueryResult[]>> {
    return axios.post('/api/gdgl/queryGdgzList', data)
  }
  /**
   * 撤销归档审核
   */
  static recallGdsh(data: GdshRecallInputDTO): Promise<commonOutDTO<GdshRecallOutputDTO>> {
    return axios.post('/api/gdgl/recallGdsh', data)
  }

  /**
   * 退改归档撤回
   */
  static recallTgsh(data: GdshRecallInputDTO): Promise<commonOutDTO<GdshRecallOutputDTO>> {
    return axios.post('/api/gdgl/recallTgsh', data)
  }
  /**
   * 获取案件归档登记表
   */
  static getAjgddjb(data: AjgddjbGetInputDTO): Promise<any> {
    return axios.get(`/api/gdgl/getAjgddjb?gddjbxh=${data.gddjbxh}&dwmc=${data.dwmc}`, {
      responseType: 'blob',
    })
  }

  /**
   * 新增案卷退改记录
   */
  static addAjtgjl(data: AjtgjlSaveInputDTO): Promise<commonOutDTO<AjtgjlAddOutputDTO>> {
    return axios.post('/api/gdgl/addAjtgjl', data)
  }
  /**
   * 修改案卷退改记录
   */
  static updateAjtgjl(data: AjtgjlUpdateInputDTO): Promise<commonOutDTO<AjtgjlUpdateOutputDTO>> {
    return axios.post('/api/gdgl/updateAjtgjl', data)
  }
  /**
   * 删除案卷退改记录
   */
  static deleteAjtgjl(data: AjtgjlDeleteInputDTO): Promise<commonOutDTO<AjtgjlDeleteOutputDTO>> {
    return axios.post('/api/gdgl/deleteAjtgjl', data)
  }
  /**
   * 获取退改审批表
   */
  static getTgspb(data: TgspbGetInputDTO): Promise<any> {
    return axios.get(
      `/api/gdgl/getTgspb?gdjlbh=${data.gdjlbh}&jlbh=${data.jlbh}&dwmc=${data.dwmc}`,
      {
        responseType: 'blob',
      },
    )
  }
  /**
   * 获取退改审核列表
   */
  static queryTgshList(
    data: pageCommonInputDTO<TgshListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<TgshListQueryResult[]>>> {
    return axios.post('/api/gdgl/queryTgshList', data)
  }
  /**
   * 获取退改记录列表
   */
  static queryTgjlList(data: TgjlListQueryParam): Promise<commonOutDTO<TgjlListQueryResult[]>> {
    return axios.post('/api/gdgl/queryTgjlList', data)
  }
  /**
   * 获取集中扫描列表
   */
  static queryJzsmList(
    data: pageCommonInputDTO<JzsmListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<JzsmListQueryResult[]>>> {
    return axios.post('/api/gdgl/queryJzsmList', data)
  }
  /**
   * 接收集中扫描材料
   */
  static receiveJzsmcl(data: JzsmclReceiveInputDTO): Promise<commonOutDTO<JzsmclReceiveOutputDTO>> {
    return axios.post('/api/gdgl/receiveJzsmcl', data)
  }
  /**
   * 退回集中扫描材料
   */
  static thJzsmcl(data: JzsmclThInputDTO): Promise<commonOutDTO<JzsmclThOutputDTO>> {
    return axios.post('/api/gdgl/thJzsmcl', data)
  }
  /**
   * 分配扫描人
   */
  static allocationSmr(data: SmrAllocationInputDTO): Promise<commonOutDTO<SmrAllocationOutputDTO>> {
    return axios.post('/api/gdgl/allocationSmr', data)
  }
  /**
   * 归还集中扫描材料
   */
  static ghJzsmcl(data: JzsmclGhInputDTO): Promise<commonOutDTO<JzsmclGhOutputDTO>> {
    return axios.post('/api/gdgl/ghJzsmcl', data)
  }
  /**
   * 获取扫描材料交接单
   */
  static getSmcljjd(data: SmcljjdGetInputDTO): Promise<commonOutDTO<SmcljjdGetOutputDTO>> {
    return axios.post('/api/gdgl/getSmcljjd', data)
  }
  /**
   * 获取归档待审核列表
   */
  static queryGddshList(
    data: pageCommonInputDTO<GddshListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<GddshListQueryResult[]>>> {
    return axios.post('/api/gdgl/queryGddshList', data)
  }
  /**
   * 获取归档已审核列表
   */
  static queryGdyshList(
    data: pageCommonInputDTO<GdyshListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<GdyshListQueryResult[]>>> {
    return axios.post('/api/gdgl/queryGdyshList', data)
  }
  /**
   * 保存归档审核记录
   */
  static saveGdshjl(data: GdshjlSaveInputDTO): Promise<commonOutDTO<GdshjlSaveOutputDTO>> {
    return axios.post('/api/gdgl/saveGdshjl', data)
  }
  /**
   * 接收实体案卷
   */
  static receiveStaj(data: StajReceiveInputDTO): Promise<commonOutDTO<StajReceiveOutputDTO>> {
    return axios.post('/api/gdgl/receiveStaj', data)
  }
  /**
   * 归还实体材料信息
   */
  static updateGhstcl(data: updateGhstclInputDTO): Promise<commonOutDTO<StajReceiveOutputDTO>> {
    return axios.post('/api/gdgl/updateGhstcl', data)
  }
  /**
   * 保存退改审核记录
   */
  static saveTgshjl(data: TgshjlSaveInputDTO): Promise<commonOutDTO<TgshjlSaveOutputDTO>> {
    return axios.post('/api/gdgl/saveTgshjl', data)
  }
  /**
   * 集中扫描完成
   */
  static updateJzsmwc(data: JzsmwcUpdateInputDTO): Promise<commonOutDTO<JzsmwcUpdateOutputDTO>> {
    return axios.post('/api/gdgl/updateJzsmwc', data)
  }
  /**
   * 获取人员信息列表
   */
  static queryRyxxList(data: RyxxListQueryParam): Promise<commonOutDTO<RyxxListQueryResult[]>> {
    return axios.post('/api/gdgl/queryRyxxList', data)
  }

  /**
   * 获取归档登记表序号
   */
  static getAjgddjbxh(data: AjgddjbxhGetInputDTO): Promise<commonOutDTO<AjgddjbxhGetOutputDTO>> {
    return axios.post('/api/gdgl/getAjgddjbxh', data)
  }

  /**
   * 接收实体材料案件信息列表
   */
  static queryJsstclAjxx(
    data: queryJsstclAjxxInputDTO,
  ): Promise<commonOutDTO<queryJsstclAjxxOutputDTO[]>> {
    return axios.post('/api/gdgl/queryJsstclAjxx', data)
  }

  /**
   * 接收实体材料案件信息列表
   */
  static queryGhstclAjxx(
    data: queryJsstclAjxxInputDTO,
  ): Promise<commonOutDTO<queryJsstclAjxxOutputDTO[]>> {
    return axios.post('/api/gdgl/queryGhstclAjxx', data)
  }

  /**
   * 生成接收实体归档交接单(接收实体材料按钮使用)
   */
  static createJsstgdjjd(data: createJsstgdjjdInputDTO): Promise<any> {
    return axios.post('/api/gdgl/createJsstgdjjd', data, { responseType: 'blob' })
  }

  /**
   * 获取集中扫描接收交接单
   */
  static getJzsmjsjjd(data: getJzsmjsjjdInputDTO): Promise<any> {
    return axios.post('/api/gdgl/getJzsmjsjjd', data, { responseType: 'blob' })
  }

  /**
   * 生成实体归档交接单（列表使用，支持批量操作）
   */
  static createStclgdjjd(data: createStclgdjjdInputDTO): Promise<any> {
    return axios.post('/api/gdgl/createStclgdjjd', data, { responseType: 'blob' })
  }

  /**
   * 获取案件二维码
   */
  static getAjerwm(data: AjerwmInputDTO): Promise<any> {
    return axios.post('/api/gdgl/getAjerwm', data, { responseType: 'blob' })
  }

  /**
   * 上传单个文件(仅上传不做任何操作)
   */
  static singleUploadFile(
    data: unknown,
    ajbh?: string,
  ): Promise<commonOutDTO<singleUploadFileOutputDTO>> {
    return axios.post('/api/gdgl/singleUploadFile', data, {
      headers: {
        ajbh,
      },
    })
  }

  // 案件归档待归档案件数量
  static getAjgddgdajsl(): Promise<commonOutDTO<any>> {
    return axios.post('/api/gdgl/getAjgddgdajsl')
  }

  // 图片旋转90度 ImgXzInputDTO
  static getImgXz(data: any, ajbh?: string): Promise<commonOutDTO<any>> {
    return axios.post('/api/gdgl/imgXzToBase64', data, {
      headers: {
        ajbh,
      },
    })
  }

  // 图片旋转90度 ImgXzInputDTO
  static getImgXzG(data: any, ajbh?: string): Promise<commonOutDTO<any>> {
    return axios.post('/api/gdgl/getImgXz', data, {
      headers: {
        ajbh,
      },
    })
  }

  // 检测案件办案成员,返回false就禁止进入整理端
  static jcajbacy(data: any): Promise<commonOutDTO<boolean>> {
    return axios.post('/api/gdgl/jcajbacy', data)
  }

  // 获取四性报告
  static getSxjcbgwjxh(data: any): Promise<commonOutDTO<any>> {
    return axios.post('/api/dagl/getSxjcbgwjxh', data)
  }
}
